package com.example.hotelapp.Activity;

import android.app.Activity;
import android.content.Context;
import android.widget.TextView;

import com.example.hotelapp.Base.BaseActivity;
import com.example.hotelapp.R;

import butterknife.BindView;

import static com.example.utils.CommonUtils.HideBarAll;
import static com.example.utils.CommonUtils.Immerse;
import static com.example.utils.CommonUtils.KeepScreenOn;
import static com.example.utils.CommonUtils.SharedInfo;
import static com.example.utils.CommonUtils.initCountDownTimer;


/**
 * APP广告页
 */
public class AdvertActivity extends BaseActivity {

    @BindView(R.id.ad)
    TextView ad;
    private Context context;
    private Activity activity;
    //要跳转的页面
    Class guide = GuideActivity.class;//登录页
    Class usersmain = MainActivity.class;//用户主页

    /**
     * 加载布局
     */
    @Override
    protected int setLayoutId() {
        return R.layout.activity_advert;
    }

    /**
     * 初始化
     */
    @Override
    protected void init() {
        context = this;
        activity = this;
        HideBarAll(this);
        String name = SharedInfo(context, "GetPhone", "phone");//获取手机号
        //如果登录过直接跳转到主页，否则跳转到登录页
        if (name != null) {
            initCountDownTimer(ad,activity,context,usersmain);
        } else {
            initCountDownTimer(ad,activity,context,guide);
        }
    }

}